<template>
  <div>
    <h1>我是裤子</h1>
    <h1>query参数：{{ kid }}</h1>
    <h1>params参数：{{ myid }}</h1>
    <button @click="GO()">去上一页</button>
    <button @click="$router.go(-1)">去上一页</button>
    <button @click="turnThree">去到装饰组件</button>
  </div>
</template>
<script>
// vue路由接受参数  this.$route.query 或this.$route.params
export default {
  data () {
    return {
      kid: '',
      myid: ''
    }
  },
  created () {
    this.kid = this.$route.query.kid
    this.myid = this.$route.params.myid
  },
  methods: {
    GO () {
      //后退一步 -1  前进一步 1
      this.$router.go(-1)
    },
    turnThree () {
      this.$router.push({ name: 'catethree', query: { ccid: '9988' } })
    }
  }
}
</script>
<style lang="less"></style>
